import request from '@/utils/request'

// 登录
export function authByCode(data) {
  return request({
    url: '/wechat/auth',
    method: 'post',
    data
  })
}
// 参与抽奖
export function submitByOpenid(data) {
  return request({
    url: '/wechat/getUserInfo',
    method: 'post',
    data
  })
}

// 获取所有用户
export function getAllUser(params) {
  return request({
    url: '/game/list_user',
    method: 'get',
    params
  })
}

// 获取可参与抽奖用户
export function getRandomUserList(params) {
  return request({
    url: '/game/list_unlucky_user',
    method: 'get',
    params
  })
}

// 记录中奖用户
export function uploadWinner(data) {
  return request({
    url: '/game/save_lucky_user',
    method: 'post',
    data
  })
}


// 记录中奖用户
export function getWinnerList(params) {
  return request({
    url: '/game/list_lucky_user',
    method: 'get',
    params
  })
}


// 场次二维码
export function getQrcode(params) {
  return request({
    url: '/game/qrcode',
    method: 'get',
    params
  })
}


// 添加测试
export function test(data) {
  return request({
    url: '/wechat/saveTest',
    method: 'post',
    data
  })
}
